package a.f.n;

import a.c.ab;
import a.c.e;
import a.c.j;
import a.c.m;
import a.c.q;
import a.c.z;
import a.d.w;
import a.f.o;
import a.f.zc;

import java.util.ArrayList;
import java.util.Comparator;

public class l
  extends k
{
  public static final Object o = "y.layout.tree.AssistantPlacer.ASSISTANT_DPKEY";
  private gb p;
  private s q;
  public static int r;
  
  public l()
  {
    this(k.b_.a);
  }
  
  public l(k.b_ paramb_)
  {
    super(paramb_);
    this.q = new s(paramb_);
    this.p = new t(paramb_, k.c_.a);
    ((t)this.p).a(true);
    ((t)this.p).a(k.c_.b);
  }
  
  protected byte d(e parame)
  {
    throw new IllegalStateException("Should not be called");
  }
  
  public void a(e parame, j paramj)
  {
    this.q.a(parame, paramj);
  }
  
  protected d.a_ e(e parame)
  {
    return (d.a_)this.k.get(parame);
  }
  
  public ib a(d paramd, o paramo, e parame)
  {
    if (parame.e() == 0) {
      return null;
    }
    return new b_(paramo, parame);
  }
  
  public void a(double paramDouble)
  {
    super.a(paramDouble);
    this.q.a(paramDouble);
  }
  
  public d.a_ a(a.c.k paramk1, a.c.k paramk2, o paramo, e parame, byte paramByte)
  {
    if ((k.n) || (parame.e() == 0)) {
      return (d.a_)paramk1.get(parame);
    }
    this.k = paramk1;
    this.j = paramk2;
    this.h = paramo;
    this.l = new ArrayList();
    a.c.d locald = a(paramo, parame);
    paramo.a(locald, locald.e(), locald.e().j(), 0, locald.f(), null, 1);
    return this.q.a(paramk1, paramk2, paramo, parame, paramByte);
  }
  
  private static a.c.d a(o paramo, e parame)
  {
    boolean bool2 = k.n;
    boolean bool1 = k.m;
    a.c.k localk = paramo.c(o);
    a.c.d locald = parame.h();
    if (locald != null) {
      if ((bool2) || (localk != null))
      {
        if (bool2) {
          break label63;
        }
        if (localk.getBool(locald.f())) {
          break label56;
        }
      }
    }
    label56:
    label63:
    while (bool2)
    {
      return locald;
      locald = locald.i();
      if (!bool1) {
        break;
      }
    }
    throw new IllegalStateException("No edge found that is *not* an assistant");
  }
  
  protected v a(e parame, byte paramByte)
  {
    throw new IllegalStateException("Should not be called");
  }
  
  public void a(gb paramgb)
  {
    this.p = paramgb;
  }
  
  public gb e()
  {
    return this.p;
  }
  
  public Comparator c()
  {
    Comparator localComparator1 = this.q.a();
    Comparator localComparator2 = (k.n) || ((this.p instanceof bb)) ? ((bb)this.p).a() : null;
    return a(localComparator1, localComparator2);
  }
  
  public static Comparator a(Comparator paramComparator1, Comparator paramComparator2)
  {
    new Comparator()
    {
      private final Comparator val$assistantComparator;
      private final Comparator val$childComparator;
      
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        boolean bool = k.n;
        a.c.d locald1 = (a.c.d)paramAnonymousObject1;
        a.c.d locald2 = (a.c.d)paramAnonymousObject2;
        q localq = locald1.c();
        a.c.k localk = localq.c(l.o);
        if ((bool) || (localk != null)) {
          if (bool) {}
        }
        int i = localk.getBool(locald1.f()) ? 1 : 0;
        if ((bool) || (localk != null)) {
          if (bool) {}
        }
        int j = localk.getBool(locald2.f()) ? 1 : 0;
        if (!bool) {
          if (i != j)
          {
            if (!bool) {}
            return i != 0 ? -1 : 1;
          }
        }
        if ((bool) || ((i != 0) && (j != 0))) {
          return (bool) || (this.val$assistantComparator != null) ? this.val$assistantComparator.compare(paramAnonymousObject1, paramAnonymousObject2) : 0;
        }
        return (bool) || (this.val$childComparator != null) ? this.val$childComparator.compare(paramAnonymousObject1, paramAnonymousObject2) : 0;
      }
    };
  }
  
  private static final class c_
    implements Comparator
  {
    private c_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      return 0;
    }
    
    c_(l.0 param0)
    {
      this();
    }
  }
  
  private class b_
    implements ib
  {
    final x a = new x();
    private final o b;
    private final e c;
    private a.c.d d;
    
    b_(o paramo, e parame)
    {
      this.b = paramo;
      this.c = parame;
    }
    
    public void a(j paramj1, j paramj2, j paramj3)
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      e locale = this.b.i();
      zc localzc = this.b.k(locale);
      localzc.b(1.0D, 1.0D);
      localzc.a(0.0D, 0.0D);
      paramj2.a(locale, this.a);
      a.c.k localk = this.b.c(l.o);
      if (!bool2) {
        if (this.c.e() > 0)
        {
          Comparator localComparator = (Comparator)paramj3.get(this.c);
          paramj3.a(this.c, new l.c_(null));
          Object localObject2;
          if (localComparator != null)
          {
            localObject1 = new ab();
            localObject2 = this.c.h();
            if (localObject2 != null) {
              if ((bool2) || (localk != null))
              {
                if (bool2) {
                  break label195;
                }
                if (localk.getBool(((a.c.d)localObject2).f())) {
                  break label186;
                }
              }
            }
            label186:
            label195:
            do
            {
              ((ab)localObject1).add(localObject2);
              localObject2 = ((a.c.d)localObject2).i();
              if (!bool1) {
                break;
              }
              ((ab)localObject1).a(localComparator);
            } while (bool2);
            localObject2 = ((ab)localObject1).l();
            do
            {
              if (!((m)localObject2).e()) {
                break;
              }
              this.b.a(((m)localObject2).a(), locale, ((m)localObject2).a().f());
              ((m)localObject2).f();
              if (bool2) {
                break label291;
              }
              if (bool1) {
                break label289;
              }
            } while (!bool1);
            if (bool2) {
              break label298;
            }
            this.c.b(localComparator);
            label289:
            label291:
            if (!bool1) {
              break label375;
            }
          }
          label298:
          Object localObject1 = this.c.h();
          do
          {
            if (localObject1 == null) {
              break;
            }
            localObject2 = ((a.c.d)localObject1).i();
            if (bool1) {
              return;
            }
            if ((bool2) || (localk != null))
            {
              if (bool2) {
                continue;
              }
              if (localk.getBool(((a.c.d)localObject1).f())) {}
            }
            else
            {
              this.b.a((a.c.d)localObject1, locale, ((a.c.d)localObject1).f());
            }
            localObject1 = localObject2;
          } while (!bool1);
        }
      }
      label375:
      this.d = this.b.a(this.c, locale);
      if (!bool2) {
        paramj1.a(locale, l.this.p);
      }
    }
    
    public void a()
    {
      boolean bool2 = k.n;
      boolean bool1 = k.m;
      e locale = this.d.f();
      w localw = this.b.p(this.d);
      z localz1 = this.b.m(this.d);
      localz1.add(this.b.o(locale));
      Object localObject = locale.h();
      do
      {
        if (localObject == null) {
          break;
        }
        a.c.d locald = ((a.c.d)localObject).i();
        this.b.a((a.c.d)localObject, this.c, ((a.c.d)localObject).f());
        z localz2 = new z(localz1);
        localz2.addAll(this.b.m((a.c.d)localObject));
        this.b.b((a.c.d)localObject, localz2);
        this.b.a((a.c.d)localObject, localw);
        localObject = locald;
        if ((!bool2) && (bool1)) {
          return;
        }
      } while (!bool1);
      if (!bool2) {
        this.b.a(locale);
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.n.l

 * JD-Core Version:    0.7.0.1

 */